import request from '@/utils/request'
// 获取角色列表
export const getRoleList = (data) => {
  return request({
    url: '/userservice/role/list',
    method: 'GET',
    data
  })
}
// 获取权限列表
export const getMenuRoleList = (data) => {
  return request({
    url: '/userservice/menu/treeList',
    method: 'GET',
    data
  })
}
// 获取角色类型
export const getRoleTypeSelector = () => {
  return request({
    url: '/userservice/role/list',
    method: 'GET'
  })
}
// 获取角色相对应的权限
export const getUserRoleList = () => {
  return request({
    url: '/userservice/menu/userlist',
    method: 'GET'
  })
}
// 保存角色接口
export const onAddOrUpdate = (data) => {
  return request({
    url: '/userservice/role/addOrUpdate',
    method: 'POST',
    data
  })
}
// 删除角色接口
export const delRole = (data) => {
  return request({
    url: '/userservice/role/delRole',
    method: 'POST',
    data
  })
}
// 更改角色的权限
export const saveRoleAuth = (data) => {
  return request({
    url: '/userservice/role/setRoleAuth',
    method: 'POST',
    data
  })
}
